<template>
    <div class="box1">
        <div class="a1">
            <h1>找回密码</h1>

            <a-form :model="formState" name="normal_login" class="login-form" @finish="onFinish"
                @finishFailed="onFinishFailed">
                <a-form-item name="username" :rules="[{ required: true, message: '请输入手机号!' }]">
                    <a-input v-model:value="formState.username" placeholder="请输入手机号"
                        style="height:50px;border-radius: 8px;">
                        <template #prefix>
                            <!-- <UserOutlined class="" /> -->
                            <phone-two-tone :rotate="120" />
                        </template>
                    </a-input>
                </a-form-item>
                <div>
                    <a-form-item name="password" :rules="[{ required: true, message: '请输入验证码!' }]">
                        <a-input v-model:value="formState.password" placeholder="请输入验证码"
                            style="width:200px;height: 50px;border-radius: 8px;float: left;;">
                            <template #prefix>
                                <!-- <LockOutlined class="site-form-item-icon" /> -->
                                <icon :style="{ fontSize: '22px' }" spin>
                                    <template #component="svgProps">
                                        <svg viewBox="0 0 1024 1024" width="1em" height="1em" fill="currentColor"
                                            v-bind="svgProps">
                                            <path
                                                d="M99.096 315.634s-82.58-64.032-82.58-132.13c0-66.064 33.032-165.162 148.646-148.646 83.37 11.91 99.096 165.162 99.096 165.162l-165.162 115.614zM924.906 315.634s82.58-64.032 82.58-132.13c0-66.064-33.032-165.162-148.646-148.646-83.37 11.91-99.096 165.162-99.096 165.162l165.162 115.614z"
                                                fill="#6B676E" p-id="1143" />
                                            <path
                                                d="M1024 561.548c0 264.526-229.23 429.42-512.002 429.42S0 826.076 0 561.548 283.96 66.064 512.002 66.064 1024 297.022 1024 561.548z"
                                                fill="#FFEBD2" p-id="1144" />
                                            <path
                                                d="M330.324 842.126c0 82.096 81.34 148.646 181.678 148.646s181.678-66.55 181.678-148.646H330.324z"
                                                fill="#E9D7C3" p-id="1145" />
                                            <path
                                                d="M644.13 611.098C594.582 528.516 561.55 512 512.002 512c-49.548 0-82.58 16.516-132.13 99.096-42.488 70.814-78.73 211.264-49.548 247.742 66.064 82.58 165.162 33.032 181.678 33.032 16.516 0 115.614 49.548 181.678-33.032 29.18-36.476-7.064-176.93-49.55-247.74z"
                                                fill="#FFFFFF" p-id="1146" />
                                            <path
                                                d="M611.098 495.484c0-45.608 36.974-82.58 82.58-82.58 49.548 0 198.194 99.098 198.194 165.162s-79.934 144.904-148.646 99.096c-49.548-33.032-132.128-148.646-132.128-181.678zM412.904 495.484c0-45.608-36.974-82.58-82.58-82.58-49.548 0-198.194 99.098-198.194 165.162s79.934 144.904 148.646 99.096c49.548-33.032 132.128-148.646 132.128-181.678z"
                                                fill="#6B676E" p-id="1147" />
                                            <path
                                                d="M512.002 726.622c-30.06 0-115.614 5.668-115.614 33.032 0 49.638 105.484 85.24 115.614 82.58 10.128 2.66 115.614-32.944 115.614-82.58-0.002-27.366-85.556-33.032-115.614-33.032z"
                                                fill="#464655" p-id="1148" />
                                            <path
                                                d="M330.324 495.484m-33.032 0a33.032 33.032 0 1 0 66.064 0 33.032 33.032 0 1 0-66.064 0Z"
                                                fill="#464655" p-id="1149" />
                                            <path
                                                d="M693.678 495.484m-33.032 0a33.032 33.032 0 1 0 66.064 0 33.032 33.032 0 1 0-66.064 0Z"
                                                fill="#464655" p-id="1150" />
                                        </svg>
                                    </template>
                                </icon>

                            </template>
                        </a-input>
                        <button
                            style="margin-left:20px;background-color: #535FFE;border: 1px ;width:120px;height:50px;border-radius: 8px;color:white;letter-spacing: 2px;">发送验证码</button>

                    </a-form-item>
                </div>

                <!-- 确认密码 -->
                <a-form-item name="username" :rules="[{ required: true, message: '请输入手机号!' }]">
                    <a-input v-model:value="formState.username" placeholder="请输入手机号"
                        style="height:50px;border-radius: 8px;">
                        <template #prefix>
                            <!-- <UserOutlined class="" /> -->
                            <unlock-two-tone />
                        </template>
                    </a-input>
                </a-form-item>

                <!-- 再次确认密码 -->
                <a-form-item name="username" :rules="[{ required: true, message: '请输入手机号!' }]">
                    <a-input v-model:value="formState.username" placeholder="请输入手机号"
                        style="height:50px;border-radius: 8px;">
                        <template #prefix>
                            <!-- <UserOutlined class="" /> -->
                            <unlock-two-tone />
                        </template>
                    </a-input>
                </a-form-item>

                <!-- 确定按钮 -->
                <a-form-item>
                    <a-button type="primary" html-type="submit" class="login-form-button"
                        style="width:100%;background-color:#5E6BFF ;height:50px;border-radius: 6px;">
                        <span style="font-size: 20px;letter-spacing: 3px;"> 确定</span>
                    </a-button>
                    
                    <p style="text-align: center;margin-top: 20px;"><a href="###" style="color:#8089FF;">已有账号,去登录</a></p>
                </a-form-item>
            </a-form>
        </div>
    </div>
</template>

<script lang="ts">
import { defineComponent, reactive, computed } from 'vue';
import { PhoneTwoTone, UnlockTwoTone, UserOutlined, LockOutlined, Html5TwoTone, CarTwoTone } from '@ant-design/icons-vue';
import Icon, { HomeOutlined } from '@ant-design/icons-vue';
interface FormState {
    username: string;
    password: string;
    remember: boolean;
}
export default defineComponent({
    components: {
        UserOutlined,
        LockOutlined,
        Html5TwoTone,
        CarTwoTone,
        UnlockTwoTone,
        PhoneTwoTone,
        Icon,
        HomeOutlined
    },
    setup() {
        const formState = reactive<FormState>({
            username: '',
            password: '',
            remember: true,
        });
        const onFinish = (values: any) => {
            console.log('Success:', values);
        };

        const onFinishFailed = (errorInfo: any) => {
            console.log('Failed:', errorInfo);
        };
        const disabled = computed(() => {
            return !(formState.username && formState.password);
        });

        return {
            formState,
            onFinish,
            onFinishFailed,
            disabled,
        }
    }
})
</script>

<style lang="less" scoped>
.box1 {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url(@/assets/beijng.png);
}

.a1 {
    width: 600px;
    border-radius: 20px;
    box-shadow: 3px 3px 10px rgb(34, 34, 34);
    height: 600px;
    background-color: white;
    padding: 40px 150px 40px 110px;
    // display: flex;
    // justify-content: space-evenly;
    // align-items: center;

    h1 {
        font-weight: bold;
        color: black;
        font-size: 30px;
    }
}

#components-form-demo-normal-login .login-form {
    max-width: 300px;
}

#components-form-demo-normal-login .login-form-forgot {
    float: right;
}

#components-form-demo-normal-login .login-form-button {
    width: 100%;
}
</style>